package com.atguigu.yygh.cmn.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author:ahang
 * @create:2022-08-30 9:34
 * @Description:
 */
@ComponentScan(basePackages = "com.atguigu")  //指定要扫描的包路径
@SpringBootConfiguration
@EnableTransactionManagement  //开启事务
@MapperScan(basePackages = "com.atguigu.yygh.cmn.mapper")
public class CmnConfig {

    @Bean
    public PaginationInterceptor paginationInterceptor(){
        return new PaginationInterceptor();
    }
}